package cn.com.xiaoshoujia.wallet.controller;

import cn.com.xiaoshoujia.application.service.WalletService;
import cn.com.xiaoshoujia.constants.Scene;
import cn.com.xiaoshoujia.domain.dto.SettlementDTO;
import cn.com.xiaoshoujia.infrastructure.utils.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.List;

@RestController
public class WalletController {

    @Autowired
    WalletService walletService;

//    @GetMapping(value = "index")
    public String index() {
        SettlementDTO settlementDTO = new SettlementDTO();
        settlementDTO.setFkCompanyXcode("402880855D552824015D6420BBC50001");
        settlementDTO.setScene(Scene.TEAM_HEAD_SUCCESS.getCode());
        settlementDTO.setOpeartor("402880855D552824015D6420BBC50001");
        settlementDTO.setOpeartorType(0);
        List<String> list = new ArrayList();
        list.add("1504515850883165402");
        list.add("1504515936102748325");
        settlementDTO.setListOrderId(list);
        try {
            Result result = walletService.settlement(settlementDTO);
            System.out.println(result.getCode() + "-" + result.getObject());
        } catch (Exception e) {
            System.out.println(e.toString());
        }
        return "1";
    }
}
